C-------------------------------------------------------------------
      INTEGER FUNCTION LASTC( STRING )
C     FIND THE LAST NON BLANK CHARACTER IN THE STRING 'STRING'.
C     (CONTROL CHARACTERS ARE CONSIDERED TO BE BLANKS).
      IMPLICIT NONE
      CHARACTER STRING*(*)
      INTEGER I
      INTEGER L
C
      L = LEN( STRING )
      DO 1000 I=L,1,-1
         IF( STRING(I:I) .GT. ' ' ) THEN
            LASTC = I
            RETURN
         ENDIF
 1000 CONTINUE
      LASTC = 0
      RETURN
      END
